(copy-face): Create the new face explicitly if it does not exist already.
authorRichard M. Stallman <rms@gnu.org>
Sun, 23 Dec 2007 18:08:38 +0000 (18:08 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 23 Dec 2007 18:08:38 +0000 (18:08 +0000)
lisp/faces.el

index ceadb6f764f5fd0202787209ac387be9f0cd8e6f..a1b069e9ba6f30501f95a6692868c178a1f5d28c 100644 (file)
@@ -158,13 +158,18 @@ and for each existing frame.
 
 If the optional fourth argument NEW-FRAME is given,
 copy the information from face OLD-FACE on frame FRAME
-to NEW-FACE on frame NEW-FRAME."
+to NEW-FACE on frame NEW-FRAME.  In this case, FRAME may not be nil."
   (let ((inhibit-quit t))
     (if (null frame)
        (progn
+         (when new-frame
+           (error "Copying face %s from all frames to one frame"
+                  old-face))
+         (make-empty-face new-face)
          (dolist (frame (frame-list))
            (copy-face old-face new-face frame))
          (copy-face old-face new-face t))
+      (make-empty-face new-face)
       (internal-copy-lisp-face old-face new-face frame new-frame))
     new-face))